package cn.u313.entry;

import cn.u313.comm.utils.BiaoQing;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import static cn.u313.comm.conststring.Const.icon;

/**
 * 嘤鱼表
 */

@Entity
@Table(name = "t_yanyu")
public class YanYuEntry {

        //嘤鱼系统
        //抽奖 或者 300 获取 嘤鱼
        //每天给鱼味嘤料 (悦币购买) 1:1
        //嘤鱼 10级
        //每天 喂鱼 随机得 嘤币
        //嘤鱼大鱼吃小鱼 每天一次 加对面的10% 经验
        //可以用悦币买免吃道具
        //每天鱼群抓鱼随机的经验
        //
    @Id
    @Getter
    @Setter
    private int id;
    @Getter
    @Setter
    private int exp;//经验
    @Getter
    @Setter
    private double yingBi;//嘤币
    @Getter
    @Setter
    private int chiYu;// 时间
    @Getter
    @Setter
    private int baoHu;//保
    @Getter
    @Setter
    private String qq;//QQ
    @Getter
    @Setter
    private String time;//获得时间
    @Getter
    @Setter
    private String groupNumber;//群
    int p=0;
    int dengji=0;//等级
    int chaExp=0;//下一级cha
    private void getDengji(){
        int p=200;
        int num=0;
//        int shangyige=
        for(int i=0;i<50;i++) {
            //System.out.println("i:"+(i+1)+"\tp:"+p+"\tnum:"+num);
            if(exp<num){

                break;
            }
            dengji=(i+1);
            chaExp=p+10-(exp-num);
            p+=10;
            num+=p;
//            if

        }
    }
    @Override
    public String toString() {
        getDengji();
        p=(exp)/1000*30+160;
        if(dengji<1){
            return icon+ "嘤鱼退化成 [ 嘤细胞 ]\n"+
                    icon+ "等级 "+dengji+" 级 \n"+
                    icon+  "嘤币数量："+yingBi+"\n"+
                    icon+  "嘤鱼成长值："+exp+"\n"+
                    icon+  "离下一级：还差 "+chaExp+"成长"+
                    BiaoQing.getImg();
        }else
        if(dengji<5){
            return icon+ "嘤鱼发育成 [ 小嘤鱼 ]\n"+
                    icon+ "等级 "+dengji+" 级 \n"+
                    icon+  "嘤币数量："+yingBi+"\n"+
                    icon+  "嘤鱼成长值："+exp+"\n"+
                    icon+  "离下一级：还差 "+chaExp+"成长"+
                    BiaoQing.getImg();
        }else
        if(dengji<10){
            return icon+ "嘤鱼发育成 [ 大嘤鱼 ]\n"+
                    icon+ "等级 "+dengji+" 级 \n"+
                    icon+  "嘤币数量："+yingBi+"\n"+
                    icon+  "嘤鱼成长值："+exp+"\n"+
                    icon+  "离下一级：还差 "+chaExp+"成长"+
                    BiaoQing.getImg();
        }else  if(dengji<20){
            return icon+"嘤鱼发育成 [ 巨嘤 ]\n" +
                    icon+"等级为"+dengji+" 级 \n"+
                    icon+"嘤币数量："+yingBi+"\n"+
                    icon+"嘤成长值："+exp+""+"\n"+
                    icon+  "离下一级：还差 "+chaExp+"成长"+
                    BiaoQing.getImg();
        }else if(dengji<30){
            return icon+"嘤鱼已进化成[ 鲸嘤 ]\n" +
                    icon+"等级为"+dengji+" 级 \n"+
                    icon+"嘤币数量："+yingBi+"\n"+
                    icon+"鲸成长值："+exp+""+"\n"+
                    icon+  "离下一级：还差 "+chaExp+"成长"+
                    BiaoQing.getImg();
        }else if(dengji<40){
            return icon+"嘤鱼已进化成[ 嘤有尽有 ]\n" +
                    icon+"等级为"+dengji+" 级 \n"+
                    icon+"嘤币数量："+yingBi+"\n"+
                    icon+"鲸成长值："+exp+""+"\n"+
                    icon+  "离下一级：还差 "+chaExp+"成长"+
                    BiaoQing.getImg();
        }else if(dengji<50){
            return icon+"嘤鱼已进化成[ 嘤姿飒爽 ]\n" +
                    icon+"等级为"+dengji+" 级 \n"+
                    icon+"嘤币数量："+yingBi+"\n"+
                    icon+"鲸成长值："+exp+""+"\n"+
                    icon+  "离下一级：还差 "+chaExp+"成长"+
                    BiaoQing.getImg();
        }else if(dengji<60){
            return icon+"嘤鱼已进化成[ 小嘤 ]\n" +
                    icon+"等级为"+dengji+" 级 \n"+
                    icon+"嘤币数量："+yingBi+"\n"+
                    icon+"嘤嘤成长值："+exp+""+"\n"+
                    icon+  "离下一级：还差 "+chaExp+"成长"+
                    BiaoQing.getImg();
        }else{
            return icon+"嘤鱼已超进化成[ 嘤年早逝 ]\n" +
                    icon+"等级为"+dengji+" 级 \n"+
                    icon+"嘤币数量："+yingBi+"\n"+
                    icon+"嘤嘤成长值："+exp+""+"\n"+
                    icon+  "恭喜你已到达最高等级"+
                    BiaoQing.getImg();
        }

    }
}
